const app = getApp();

Page({
  /**
   * 页面的初始数据
   */
  data: {
    deviceInfo: {
      name: "智能音箱旗舰版",
      image: "/assets/images/device.png",
      tags: ["红外遥控家电", "海量有声资源"],
    },
    faqList: [
      {
        id: 1,
        title: "智能音箱如何配网",
        isHot: true,
        url: "/pages/help/details/wifi-setup",
      },
      {
        id: 2,
        title: "智能音箱如何设置音色",
        isHot: true,
        url: "/pages/help/details/sound-setup",
      },
      {
        id: 3,
        title: "无屏音箱固件升级",
        isHot: false,
        url: "/pages/help/details/firmware-update",
      },
      {
        id: 4,
        title: "智能音箱唤醒后指令不应答怎么办",
        isHot: false,
        url: "/pages/help/details/no-response",
      },
    ],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // 可以在这里从服务器获取最新的设备和FAQ数据
  },

  /**
   * 导航返回
   */
  navigateBack: function () {
    wx.navigateBack();
  },

  /**
   * 跳转到电子说明书
   */
  navigateToManual: function () {
    wx.navigateTo({
      url: "/pages/help/manual/manual",
    });
  },

  /**
   * 跳转到购买页面
   */
  navigateToBuy: function () {
    // 可以打开商城小程序或跳转到购买页面
    wx.navigateTo({
      url: "/pages/shop/product-detail?id=xiaodu-speaker",
    });
  },

  /**
   * 跳转到基础设置页面
   */
  navigateToBasicSettings: function () {
    wx.navigateTo({
      url: "/pages/help/basic-settings/index",
    });
  },

  /**
   * 跳转到功能介绍页面
   */
  navigateToFunctions: function () {
    wx.navigateTo({
      url: "/pages/help/functions/index",
    });
  },

  /**
   * 跳转到其他内容页面
   */
  navigateToOtherContent: function () {
    wx.navigateTo({
      url: "/pages/help/other-content/index",
    });
  },

  /**
   * 跳转到配网帮助页面
   */
  navigateToWifiSetup: function () {
    wx.navigateTo({
      url: "/pages/help/details/wifi-setup",
    });
  },

  /**
   * 跳转到音色设置帮助页面
   */
  navigateToSoundSetup: function () {
    wx.navigateTo({
      url: "/pages/help/details/sound-setup",
    });
  },

  /**
   * 跳转到固件升级帮助页面
   */
  navigateToFirmwareUpdate: function () {
    wx.navigateTo({
      url: "/pages/help/details/firmware-update",
    });
  },

  /**
   * 跳转到指令不应答帮助页面
   */
  navigateToNoResponse: function () {
    wx.navigateTo({
      url: "/pages/help/details/no-response",
    });
  },

  /**
   * 导航到主页
   */
  navigateToHome: function () {
    wx.redirectTo({
      url: "/pages/home/home",
    });
  },

  /**
   * 导航到歌曲页面
   */
  navigateToSongs: function () {
    wx.redirectTo({
      url: "/pages/songs/songs",
    });
  },

  /**
   * 导航到用户页面
   */
  navigateToUser: function () {
    wx.redirectTo({
      url: "/pages/user/user",
    });
  },
});
